Ext.define("App.project.view.ProjectFormPanel", {
    extend: 'Ext.form.Panel',
    alias: 'widget.ProjectFormPanel',
    title: '项目信息',
    items: [{
        xtype: 'InnerProjectInfo', region: 'center'
    }],
    initComponent: function () {
        var me = this;
        this.loader = {
            loadMask: '加载...',
            loadOnRender: true,
            autoLoad: false,
            url: 'project/edit',
            params: {id: me.up('IterationReport').node.data.id},
            renderer: function (loader, response, active) {
                var result = response.result;
                if (result.success == true) {
                    me.loadRecord(Ext.create('App.project.model.ProjectModel', response.result.data));
                }
                return true;
            }
        }
        this.callParent(arguments);
    }
});

Ext.define('App.project.view.InnerProjectInfo', {
    extend: 'Ext.panel.Panel',
    alias: ['widget.InnerProjectInfo'],
    layout: 'column',
    defaults: {
        labelWidth: 110,
        columnWidth: .25,
        readOnly: true,
        labelAlign: 'right',
        margin: '5 5 5 5',
        height: 32,
        labelStyle: "padding-top:8px;",
        fieldStyle: "padding:0px 6px 2px"
    },
    items: [{
        xtype: 'textfield',
        fieldLabel: '内部PO号',
        name: 'innerPoNumber',
        readOnly: true
    }, {
        xtype: 'textfield',
        fieldLabel: '项目名称',
        name: 'name',
        readOnly: true
    }, {
        xtype: 'textfield',
        fieldLabel: '项目编码',
        name: 'projectCode',
        readOnly: true
    }, {
        xtype: 'textfield',
        fieldLabel: '项目经理',
        name: 'projectManager',
        readOnly: true
    }, {
        xtype: 'textfield',
        fieldLabel: '项目经理工号',
        name: 'pmNo',
        readOnly: true
    }, {
        xtype: 'textfield',
        fieldLabel: '项目需求总人数',
        name: 'itemPlanMember',
        readOnly: true
    }, {
        xtype: 'textfield',
        fieldLabel: 'PO占比',
        name: 'poProportion',
        readOnly: true
    }, {
        xtype: 'textfield',
        fieldLabel: '预计工作量(人天)',
        name: 'projectWorkload',
        readOnly: true
    }, {
        xtype: 'textfield',
        fieldLabel: '所在DU',
        name: 'du',
        readOnly: true
    }, {
        xtype: 'textfield',
        fieldLabel: '所在交付部',
        name: 'dd',
        readOnly: true
    }, {
        xtype: 'textfield',
        fieldLabel: '所在地域',
        name: 'area',
        readOnly: true
    }, {
        xtype: 'datefield',
        fieldLabel: '启动实际日期',
        name: 'startDate',
        readOnly: true,
        format: 'Y-m-d'
    }, {
        xtype: 'datefield',
        fieldLabel: '预计结项时间',
        name: 'plannedEndDate',
        readOnly: true,
        format: 'Y-m-d'
    }, {
        xtype: 'textfield',
        fieldLabel: '项目类型',
        name: 'projectType',
        readOnly: true
    }, {
        xtype: 'textfield',
        fieldLabel: '是否为上网项目',
        name: 'business',
        readOnly: true
    }, {
        xtype: 'textfield',
        fieldLabel: '计费类型',
        name: 'billingType',
        readOnly: true
    }, {
        xtype: 'textfield',
        fieldLabel: '中软QA',
        name: 'chinasoftQa',
        readOnly: true
    }, {
        xtype: 'textfield',
        fieldLabel: '华为QA',
        name: 'huaweiQa',
        readOnly: true
    }, {
        xtype: 'textfield',
        fieldLabel: '华为项目经理',
        name: 'huaweiProjectManager',
        readOnly: true
    }]
});